package com.zrrd.learn.chapter08.thread;

/**
 * lambda表达式
 *
 * @author asus
 * @version 1.0
 * @date 2023/8/2 11:20
 */
public class Thread03 {

    public static void main(String[] args) {
        //创建线程  匿名
        Runnable t1=new Runnable() {
            @Override
            public void run() {
                System.out.println("我是线程");
            }
        };
        new Thread(t1).start();

        //lambda表达式
        Runnable t2 = ()->{
            System.out.println("我是线程");
        };
        new Thread(t2).start();

        //就用哪一个
        Thread t3 = new Thread(()->{
            System.out.println("ttt");
        });

        t3.start();

        Thread t4 = new Thread(()->{
            System.out.println("ttt"+Thread.currentThread().getName());
        },"哈尔滨");
        t4.start();

    }



    }


